﻿namespace QLPhongKham.UC
{
    using ConfigDatabase.Class;
    using DevExpress.Data;
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Base;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraTab;
    using QLPhongKham.Access;
    using QLPhongKham.Access.Duoc;
    using QLPhongKham.Report;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.IO;
    using System.Windows.Forms;

    public class ucd_bc_nhapxuatton : XtraUserControl
    {
        private ConnectDatabase _condata;
        private DTonKho _dton;
        private General _xuli;
        private SimpleButton btnin;
        private SimpleButton btnketthuc;
        private SimpleButton btnxem;
        private IContainer components;
        private DateEdit dtpdenngay;
        private DateEdit dtptungay;
        private GridControl gridds;
        private GridColumn gridds_dvt;
        private GridColumn gridds_id;
        private GridColumn gridds_ma;
        private GridColumn gridds_slnhap;
        private GridColumn gridds_sltoncuoi;
        private GridColumn gridds_sltondau;
        private GridColumn gridds_slxuat;
        private GridColumn gridds_ten;
        private GridView gridView1;
        private GroupControl groupControl1;
        private Label label1;
        private Label label2;
        private Label label4;
        private RepositoryItemTextEdit repositoryItemTextEdit1;

        public ucd_bc_nhapxuatton()
        {
            this.components = null;
            this.InitializeComponent();
            this._condata = new ConnectDatabase();
        }

        public ucd_bc_nhapxuatton(ConnectDatabase condata)
        {
            this.components = null;
            this.InitializeComponent();
            this._condata = condata;
        }

        private void btnin_Click(object sender, EventArgs e)
        {
            DataTable dataSource = (DataTable) this.gridds.DataSource;
            try
            {
                dataSource.Columns.Add("tungay");
                dataSource.Columns.Add("denngay");
            }
            catch
            {
            }
            for (int i = 0; i < dataSource.Rows.Count; i++)
            {
                dataSource.Rows[i]["tungay"] = this.dtptungay.Text;
                dataSource.Rows[i]["denngay"] = this.dtpdenngay.Text;
            }
            dataSource.AcceptChanges();
            DataSet data = new DataSet();
            data.Tables.Add(dataSource.Copy());
            data.WriteXml(Directory.GetCurrentDirectory() + @"\dataxml\d_bc_nhapxuatton.xml", XmlWriteMode.WriteSchema);
            new XtraReport1().f_load(data, "d_bc_nhapxuatton.repx");
        }

        private void btnketthuc_Click(object sender, EventArgs e)
        {
            try
            {
                XtraTabPage parent = (XtraTabPage) base.Parent;
                XtraTabControl control = (XtraTabControl) parent.Parent;
                control.TabPages.Remove(parent);
            }
            catch
            {
            }
        }

        private void btnmoi_Click(object sender, EventArgs e)
        {
            DataTable table = new DataTable();
            DateTime editValue = (DateTime) this.dtptungay.EditValue;
            DateTime time2 = (DateTime) this.dtpdenngay.EditValue;
            string formatdate = "dd/MM/yyyy";
            if (editValue == time2)
            {
                table = this._dton.f_load_tonkhotonghop("", formatdate).Tables[0];
            }
            else
            {
                table = this._dton.f_load_tonkhotonghop(editValue.ToString(formatdate), time2.ToString(formatdate), formatdate).Tables[0];
            }
            DataView defaultView = table.DefaultView;
            defaultView.RowFilter = "sltoncuoi>0 or sltondau>0 or slnhap>0 or slxuat>0";
            DataTable table2 = defaultView.ToTable();
            this.gridds.DataSource = table2;
            this.gridds.DataSource = table2;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void gridView1_CustomSummaryCalculate(object sender, CustomSummaryEventArgs e)
        {
        }

        private void gridView1_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
        {
        }

        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(ucd_bc_nhapxuatton));
            this.label1 = new Label();
            this.label2 = new Label();
            this.btnxem = new SimpleButton();
            this.btnketthuc = new SimpleButton();
            this.gridView1 = new GridView();
            this.gridds_ma = new GridColumn();
            this.repositoryItemTextEdit1 = new RepositoryItemTextEdit();
            this.gridds_ten = new GridColumn();
            this.gridds_id = new GridColumn();
            this.gridds_dvt = new GridColumn();
            this.gridds_sltondau = new GridColumn();
            this.gridds_slnhap = new GridColumn();
            this.gridds_slxuat = new GridColumn();
            this.gridds_sltoncuoi = new GridColumn();
            this.gridds = new GridControl();
            this.btnin = new SimpleButton();
            this.groupControl1 = new GroupControl();
            this.dtpdenngay = new DateEdit();
            this.label4 = new Label();
            this.dtptungay = new DateEdit();
            this.gridView1.BeginInit();
            this.repositoryItemTextEdit1.BeginInit();
            this.gridds.BeginInit();
            this.groupControl1.BeginInit();
            this.groupControl1.SuspendLayout();
            this.dtpdenngay.Properties.VistaTimeProperties.BeginInit();
            this.dtpdenngay.Properties.BeginInit();
            this.dtptungay.Properties.VistaTimeProperties.BeginInit();
            this.dtptungay.Properties.BeginInit();
            base.SuspendLayout();
            this.label1.BackColor = Color.ForestGreen;
            this.label1.Dock = DockStyle.Top;
            this.label1.Font = new Font("Tahoma", 16f);
            this.label1.ForeColor = Color.Yellow;
            this.label1.Location = new Point(0, 0);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x400, 0x30);
            this.label1.TabIndex = 1;
            this.label1.Text = "B\x00c1O C\x00c1O NHẬP XUẤT TỒN";
            this.label1.TextAlign = ContentAlignment.MiddleLeft;
            this.label2.Font = new Font("Tahoma", 10f);
            this.label2.Location = new Point(5, 0x1d);
            this.label2.Name = "label2";
            this.label2.Size = new Size(0x47, 0x13);
            this.label2.TabIndex = 2;
            this.label2.Text = "Từ ng\x00e0y:";
            this.label2.TextAlign = ContentAlignment.TopRight;
            this.btnxem.Appearance.Options.UseTextOptions = true;
            this.btnxem.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
            this.btnxem.Image = Properties.Resources.imgrefresh;// (Image)manager.GetObject("btnxem.Image");
            this.btnxem.Location = new Point(0x161, 0x1b);
            this.btnxem.Name = "btnxem";
            this.btnxem.Size = new Size(0x4b, 0x17);
            this.btnxem.TabIndex = 10;
            this.btnxem.Text = " &Xem";
            this.btnxem.Click += new EventHandler(this.btnmoi_Click);
            this.btnketthuc.Appearance.Options.UseTextOptions = true;
            this.btnketthuc.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
            this.btnketthuc.Image = Properties.Resources.imgclose;// (Image)manager.GetObject("btnketthuc.Image");
            this.btnketthuc.Location = new Point(0x1e6, 0x1b);
            this.btnketthuc.Name = "btnketthuc";
            this.btnketthuc.Size = new Size(0x65, 0x17);
            this.btnketthuc.TabIndex = 0x10;
            this.btnketthuc.Text = " &Kết th\x00fac [F12]";
            this.btnketthuc.Click += new EventHandler(this.btnketthuc_Click);
            this.gridView1.Appearance.ColumnFilterButton.BackColor = Color.FromArgb(0xca, 0xdd, 0xd0);
            this.gridView1.Appearance.ColumnFilterButton.BorderColor = Color.FromArgb(0xca, 0xdd, 0xd0);
            this.gridView1.Appearance.ColumnFilterButton.ForeColor = Color.Black;
            this.gridView1.Appearance.ColumnFilterButton.Options.UseBackColor = true;
            this.gridView1.Appearance.ColumnFilterButton.Options.UseBorderColor = true;
            this.gridView1.Appearance.ColumnFilterButton.Options.UseForeColor = true;
            this.gridView1.Appearance.ColumnFilterButtonActive.BackColor = Color.FromArgb(0xd3, 0xe2, 0xd8);
            this.gridView1.Appearance.ColumnFilterButtonActive.BorderColor = Color.FromArgb(0xd3, 0xe2, 0xd8);
            this.gridView1.Appearance.ColumnFilterButtonActive.ForeColor = Color.Black;
            this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseBackColor = true;
            this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseBorderColor = true;
            this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseForeColor = true;
            this.gridView1.Appearance.Empty.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.Empty.BackColor2 = Color.White;
            this.gridView1.Appearance.Empty.Options.UseBackColor = true;
            this.gridView1.Appearance.EvenRow.BackColor = Color.FromArgb(0xdd, 0xe3, 0xf5);
            this.gridView1.Appearance.EvenRow.BorderColor = Color.FromArgb(0xdd, 0xe3, 0xf5);
            this.gridView1.Appearance.EvenRow.ForeColor = Color.Black;
            this.gridView1.Appearance.EvenRow.Options.UseBackColor = true;
            this.gridView1.Appearance.EvenRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.EvenRow.Options.UseForeColor = true;
            this.gridView1.Appearance.FilterCloseButton.BackColor = Color.FromArgb(0xca, 0xdd, 0xd0);
            this.gridView1.Appearance.FilterCloseButton.BorderColor = Color.FromArgb(0xca, 0xdd, 0xd0);
            this.gridView1.Appearance.FilterCloseButton.ForeColor = Color.Black;
            this.gridView1.Appearance.FilterCloseButton.Options.UseBackColor = true;
            this.gridView1.Appearance.FilterCloseButton.Options.UseBorderColor = true;
            this.gridView1.Appearance.FilterCloseButton.Options.UseForeColor = true;
            this.gridView1.Appearance.FilterPanel.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.FilterPanel.BackColor2 = Color.White;
            this.gridView1.Appearance.FilterPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.FilterPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.FilterPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.FixedLine.BackColor = Color.FromArgb(0x75, 0x88, 0x7a);
            this.gridView1.Appearance.FixedLine.Options.UseBackColor = true;
            this.gridView1.Appearance.FocusedCell.BackColor = Color.White;
            this.gridView1.Appearance.FocusedCell.ForeColor = Color.Black;
            this.gridView1.Appearance.FocusedCell.Options.UseBackColor = true;
            this.gridView1.Appearance.FocusedCell.Options.UseForeColor = true;
            this.gridView1.Appearance.FocusedRow.BackColor = Color.FromArgb(0x81, 0xab, 0xb1);
            this.gridView1.Appearance.FocusedRow.ForeColor = Color.White;
            this.gridView1.Appearance.FocusedRow.Options.UseBackColor = true;
            this.gridView1.Appearance.FocusedRow.Options.UseForeColor = true;
            this.gridView1.Appearance.FooterPanel.BackColor = Color.FromArgb(0xca, 0xdd, 0xd0);
            this.gridView1.Appearance.FooterPanel.BorderColor = Color.FromArgb(0xca, 0xdd, 0xd0);
            this.gridView1.Appearance.FooterPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.FooterPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.FooterPanel.Options.UseBorderColor = true;
            this.gridView1.Appearance.FooterPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.GroupButton.BackColor = Color.FromArgb(0xb2, 0xd1, 0xbc);
            this.gridView1.Appearance.GroupButton.BorderColor = Color.FromArgb(0xb2, 0xd1, 0xbc);
            this.gridView1.Appearance.GroupButton.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupButton.Options.UseBorderColor = true;
            this.gridView1.Appearance.GroupFooter.BackColor = Color.FromArgb(0xd7, 0xea, 0xdd);
            this.gridView1.Appearance.GroupFooter.BorderColor = Color.FromArgb(0xd7, 0xea, 0xdd);
            this.gridView1.Appearance.GroupFooter.ForeColor = Color.Black;
            this.gridView1.Appearance.GroupFooter.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupFooter.Options.UseBorderColor = true;
            this.gridView1.Appearance.GroupFooter.Options.UseForeColor = true;
            this.gridView1.Appearance.GroupPanel.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.GroupPanel.BackColor2 = Color.White;
            this.gridView1.Appearance.GroupPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.GroupPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.GroupRow.BackColor = Color.FromArgb(0xd7, 0xea, 0xdd);
            this.gridView1.Appearance.GroupRow.BorderColor = Color.FromArgb(0xd7, 0xea, 0xdd);
            this.gridView1.Appearance.GroupRow.ForeColor = Color.Black;
            this.gridView1.Appearance.GroupRow.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.GroupRow.Options.UseForeColor = true;
            this.gridView1.Appearance.HeaderPanel.BackColor = Color.FromArgb(0xd3, 0xe2, 0xd8);
            this.gridView1.Appearance.HeaderPanel.BorderColor = Color.FromArgb(0xd3, 0xe2, 0xd8);
            this.gridView1.Appearance.HeaderPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.HeaderPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.HeaderPanel.Options.UseBorderColor = true;
            this.gridView1.Appearance.HeaderPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.HideSelectionRow.BackColor = Color.FromArgb(0xba, 0xd3, 0xd7);
            this.gridView1.Appearance.HideSelectionRow.ForeColor = Color.FromArgb(0x68, 130, 0x86);
            this.gridView1.Appearance.HideSelectionRow.Options.UseBackColor = true;
            this.gridView1.Appearance.HideSelectionRow.Options.UseForeColor = true;
            this.gridView1.Appearance.HorzLine.BackColor = Color.FromArgb(0xac, 0xc5, 180);
            this.gridView1.Appearance.HorzLine.BorderColor = Color.FromArgb(0x75, 0x88, 0x7a);
            this.gridView1.Appearance.HorzLine.Options.UseBackColor = true;
            this.gridView1.Appearance.HorzLine.Options.UseBorderColor = true;
            this.gridView1.Appearance.OddRow.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.OddRow.BorderColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.OddRow.ForeColor = Color.Black;
            this.gridView1.Appearance.OddRow.Options.UseBackColor = true;
            this.gridView1.Appearance.OddRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.OddRow.Options.UseForeColor = true;
            this.gridView1.Appearance.Preview.BackColor = Color.FromArgb(250, 250, 240);
            this.gridView1.Appearance.Preview.Font = new Font("Verdana", 7.5f);
            this.gridView1.Appearance.Preview.ForeColor = Color.FromArgb(0x68, 130, 0x86);
            this.gridView1.Appearance.Preview.Options.UseBackColor = true;
            this.gridView1.Appearance.Preview.Options.UseFont = true;
            this.gridView1.Appearance.Preview.Options.UseForeColor = true;
            this.gridView1.Appearance.Row.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.Row.ForeColor = Color.Black;
            this.gridView1.Appearance.Row.Options.UseBackColor = true;
            this.gridView1.Appearance.Row.Options.UseForeColor = true;
            this.gridView1.Appearance.RowSeparator.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.RowSeparator.BackColor2 = Color.White;
            this.gridView1.Appearance.RowSeparator.Options.UseBackColor = true;
            this.gridView1.Appearance.SelectedRow.BackColor = Color.FromArgb(0x9f, 0xc9, 0xcf);
            this.gridView1.Appearance.SelectedRow.ForeColor = Color.Black;
            this.gridView1.Appearance.SelectedRow.Options.UseBackColor = true;
            this.gridView1.Appearance.SelectedRow.Options.UseForeColor = true;
            this.gridView1.Appearance.TopNewRow.BackColor = Color.White;
            this.gridView1.Appearance.TopNewRow.Options.UseBackColor = true;
            this.gridView1.Appearance.VertLine.BackColor = Color.FromArgb(0xac, 0xc5, 180);
            this.gridView1.Appearance.VertLine.BorderColor = Color.FromArgb(0x75, 0x88, 0x7a);
            this.gridView1.Appearance.VertLine.Options.UseBackColor = true;
            this.gridView1.Appearance.VertLine.Options.UseBorderColor = true;
            this.gridView1.Columns.AddRange(new GridColumn[] { this.gridds_ma, this.gridds_ten, this.gridds_id, this.gridds_dvt, this.gridds_sltondau, this.gridds_slnhap, this.gridds_slxuat, this.gridds_sltoncuoi });
            this.gridView1.GridControl = this.gridds;
            this.gridView1.Name = "gridView1";
            this.gridView1.OptionsView.AutoCalcPreviewLineCount = true;
            this.gridView1.OptionsView.EnableAppearanceEvenRow = true;
            this.gridView1.OptionsView.EnableAppearanceOddRow = true;
            this.gridView1.OptionsView.ShowAutoFilterRow = true;
            this.gridView1.OptionsView.ShowFooter = true;
            this.gridView1.CustomSummaryCalculate += new CustomSummaryEventHandler(this.gridView1_CustomSummaryCalculate);
            this.gridView1.FocusedRowChanged += new FocusedRowChangedEventHandler(this.gridView1_FocusedRowChanged);
            this.gridds_ma.Caption = "M\x00e3 số";
            this.gridds_ma.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_ma.FieldName = "madp";
            this.gridds_ma.Name = "gridds_ma";
            this.gridds_ma.OptionsColumn.AllowEdit = false;
            this.gridds_ma.Summary.AddRange(new GridSummaryItem[] { new GridColumnSummaryItem(SummaryItemType.Count, "ma", "Số lượng={0:n0}") });
            this.gridds_ma.Visible = true;
            this.gridds_ma.VisibleIndex = 0;
            this.gridds_ma.Width = 130;
            this.repositoryItemTextEdit1.AutoHeight = false;
            this.repositoryItemTextEdit1.DisplayFormat.FormatType = FormatType.Numeric;
            this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1";
            this.repositoryItemTextEdit1.NullText = "0";
            this.repositoryItemTextEdit1.ReadOnly = true;
            this.gridds_ten.Caption = "T\x00ean dược phẩm";
            this.gridds_ten.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_ten.FieldName = "tendp";
            this.gridds_ten.Name = "gridds_ten";
            this.gridds_ten.OptionsColumn.AllowEdit = false;
            this.gridds_ten.OptionsColumn.FixedWidth = true;
            this.gridds_ten.Visible = true;
            this.gridds_ten.VisibleIndex = 1;
            this.gridds_ten.Width = 0x12e;
            this.gridds_id.Caption = "id";
            this.gridds_id.FieldName = "iddp";
            this.gridds_id.Name = "gridds_id";
            this.gridds_dvt.Caption = "ĐVT";
            this.gridds_dvt.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_dvt.FieldName = "dvt";
            this.gridds_dvt.Name = "gridds_dvt";
            this.gridds_dvt.OptionsColumn.AllowEdit = false;
            this.gridds_dvt.Visible = true;
            this.gridds_dvt.VisibleIndex = 2;
            this.gridds_dvt.Width = 0x27;
            this.gridds_sltondau.Caption = "Tồn đầu";
            this.gridds_sltondau.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_sltondau.FieldName = "sltondau";
            this.gridds_sltondau.Name = "gridds_sltondau";
            this.gridds_sltondau.OptionsColumn.AllowEdit = false;
            this.gridds_sltondau.OptionsColumn.FixedWidth = true;
            this.gridds_sltondau.Visible = true;
            this.gridds_sltondau.VisibleIndex = 3;
            this.gridds_sltondau.Width = 0x4e;
            this.gridds_slnhap.Caption = "Nhập";
            this.gridds_slnhap.DisplayFormat.FormatType = FormatType.Numeric;
            this.gridds_slnhap.FieldName = "slnhap";
            this.gridds_slnhap.Name = "gridds_slnhap";
            this.gridds_slnhap.OptionsColumn.AllowEdit = false;
            this.gridds_slnhap.OptionsColumn.ReadOnly = true;
            this.gridds_slnhap.Visible = true;
            this.gridds_slnhap.VisibleIndex = 4;
            this.gridds_slnhap.Width = 0x4a;
            this.gridds_slxuat.Caption = "Xuất";
            this.gridds_slxuat.FieldName = "slxuat";
            this.gridds_slxuat.Name = "gridds_slxuat";
            this.gridds_slxuat.OptionsColumn.AllowEdit = false;
            this.gridds_slxuat.OptionsColumn.ReadOnly = true;
            this.gridds_slxuat.Visible = true;
            this.gridds_slxuat.VisibleIndex = 5;
            this.gridds_slxuat.Width = 0x74;
            this.gridds_sltoncuoi.Caption = "Tồn cuối";
            this.gridds_sltoncuoi.DisplayFormat.FormatType = FormatType.Numeric;
            this.gridds_sltoncuoi.FieldName = "sltoncuoi";
            this.gridds_sltoncuoi.Name = "gridds_sltoncuoi";
            this.gridds_sltoncuoi.OptionsColumn.AllowEdit = false;
            this.gridds_sltoncuoi.OptionsColumn.ReadOnly = true;
            this.gridds_sltoncuoi.Visible = true;
            this.gridds_sltoncuoi.VisibleIndex = 6;
            this.gridds_sltoncuoi.Width = 0x9e;
            this.gridds.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.gridds.Location = new Point(0, 120);
            this.gridds.MainView = this.gridView1;
            this.gridds.Name = "gridds";
            this.gridds.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemTextEdit1 });
            this.gridds.Size = new Size(0x400, 0x127);
            this.gridds.TabIndex = 0x11;
            this.gridds.ViewCollection.AddRange(new BaseView[] { this.gridView1 });
            this.btnin.Image = Properties.Resources.imgprint;// (Image)manager.GetObject("btnin.Image");
            this.btnin.Location = new Point(0x1b2, 0x1b);
            this.btnin.Name = "btnin";
            this.btnin.Size = new Size(0x30, 0x17);
            this.btnin.TabIndex = 14;
            this.btnin.Text = " &In";
            this.btnin.Click += new EventHandler(this.btnin_Click);
            this.groupControl1.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
            this.groupControl1.AppearanceCaption.Font = new Font("Tahoma", 10f, FontStyle.Bold);
            this.groupControl1.AppearanceCaption.Options.UseFont = true;
            this.groupControl1.Controls.Add(this.dtpdenngay);
            this.groupControl1.Controls.Add(this.label4);
            this.groupControl1.Controls.Add(this.dtptungay);
            this.groupControl1.Controls.Add(this.btnketthuc);
            this.groupControl1.Controls.Add(this.label2);
            this.groupControl1.Controls.Add(this.btnxem);
            this.groupControl1.Controls.Add(this.btnin);
            this.groupControl1.Location = new Point(0, 0x33);
            this.groupControl1.Name = "groupControl1";
            this.groupControl1.Size = new Size(0x400, 0x3f);
            this.groupControl1.TabIndex = 0x12;
            this.groupControl1.Text = "T\x00f9y chọn";
            this.dtpdenngay.EditValue = new DateTime(0x7de, 1, 9, 2, 0x3b, 6, 15);
            this.dtpdenngay.Location = new Point(0xf2, 0x1c);
            this.dtpdenngay.Name = "dtpdenngay";
            this.dtpdenngay.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.dtpdenngay.Properties.DisplayFormat.FormatString = "dd/MM/yyyy";
            this.dtpdenngay.Properties.DisplayFormat.FormatType = FormatType.DateTime;
            this.dtpdenngay.Properties.Mask.EditMask = "dd/MM/yyyy";
            this.dtpdenngay.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.dtpdenngay.Size = new Size(100, 20);
            this.dtpdenngay.TabIndex = 3;
            this.label4.Font = new Font("Tahoma", 10f);
            this.label4.Location = new Point(0xae, 0x1d);
            this.label4.Name = "label4";
            this.label4.Size = new Size(0x47, 0x13);
            this.label4.TabIndex = 2;
            this.label4.Text = "đến ng\x00e0y:";
            this.label4.TextAlign = ContentAlignment.TopRight;
            this.dtptungay.EditValue = new DateTime(0x7de, 1, 9, 2, 0x3b, 6, 15);
            this.dtptungay.Location = new Point(0x49, 0x1c);
            this.dtptungay.Name = "dtptungay";
            this.dtptungay.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.dtptungay.Properties.DisplayFormat.FormatString = "dd/MM/yyyy";
            this.dtptungay.Properties.DisplayFormat.FormatType = FormatType.DateTime;
            this.dtptungay.Properties.Mask.EditMask = "dd/MM/yyyy";
            this.dtptungay.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.dtptungay.Size = new Size(100, 20);
            this.dtptungay.TabIndex = 3;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.Controls.Add(this.groupControl1);
            base.Controls.Add(this.gridds);
            base.Controls.Add(this.label1);
            base.Name = "ucd_bc_nhapxuatton";
            base.Size = new Size(0x400, 0x19f);
            base.Load += new EventHandler(this.ucDMSanPham_Load);
            base.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.gridView1.EndInit();
            this.repositoryItemTextEdit1.EndInit();
            this.gridds.EndInit();
            this.groupControl1.EndInit();
            this.groupControl1.ResumeLayout(false);
            this.dtpdenngay.Properties.VistaTimeProperties.EndInit();
            this.dtpdenngay.Properties.EndInit();
            this.dtptungay.Properties.VistaTimeProperties.EndInit();
            this.dtptungay.Properties.EndInit();
            base.ResumeLayout(false);
        }

        private void ucDMSanPham_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                SendKeys.Send("{Tab}");
            }
            else if (e.KeyCode == Keys.F2)
            {
                if (this.btnxem.Enabled)
                {
                    this.btnmoi_Click(null, null);
                }
            }
            else if ((e.KeyCode == Keys.F12) && this.btnketthuc.Enabled)
            {
                this.btnketthuc_Click(null, null);
            }
        }

        private void ucDMSanPham_Load(object sender, EventArgs e)
        {
            this._xuli = new General(this._condata);
            this._dton = new DTonKho(this._xuli.pConFigData);
            this.dtpdenngay.EditValue = DateTime.Now;
            this.dtptungay.EditValue = DateTime.Now.AddMonths(-1);
            this.btnmoi_Click(null, null);
        }
    }
}

